package com.wwl.qu.question01;

/**
 * author: youli
 * qq: 27855162@qq.com
 * date: 2020/6/19
 */

public class Patient {

    private String name;
    private char sex;
    private Integer age;
    private float weight;
    private boolean allergies;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public char getSex() {
        return sex;
    }

    public void setSex(char sex) {
        this.sex = sex;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public float getWeight() {
        return weight;
    }

    public void setWeight(float weight) {
        this.weight = weight;
    }

    public boolean isAllergies() {
        return allergies;
    }

    public void setAllergies(boolean allergies) {
        this.allergies = allergies;
    }

    @Override
    public String toString() {
        return "Patient{" +
                "name='" + name + '\'' +
                ", sex=" + sex +
                ", age=" + age +
                ", weight=" + weight +
                ", allergies=" + allergies +
                '}';
    }

    public static void main(String[] args) {
        Patient april=new Patient();
        april.setName("ZhangLi");
        april.setSex('f');
        april.setAge(30);
        april.setWeight(154.72f);
        april.setAllergies(true);
        System.out.println("name：  "+april.getName());
        System.out.println("sex:  "+april.getSex());
        System.out.println("age:   "+april.getAge());
        System.out.println("weight:  "+april.getWeight());
        System.out.println("allergies:  "+april.isAllergies());

        Patient patient = new Patient();
        patient.setName("Tom");
        patient.setSex('M');
        patient.setAge(40);
        patient.setWeight(123.45F);
        patient.setAllergies(false);

        System.out.println(patient);

    }
}
